//
//  LSZNoticeTableViewCell.m
//  PartyClassCloud
//
//  Created by 梁素珍 on 2018/11/11.
//  Copyright © 2018年 九酷. All rights reserved.
//

#import "LSZNoticeTableViewCell.h"

@implementation LSZNoticeTableViewCell

-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.imageViewIcon = [[UIImageView alloc]init];
        self.imageViewIcon.frame = CGRectMake(10, 10, 120, 80);
        [self addSubview:self.imageViewIcon];
        
        self.labelTitle = [[UILabel alloc]init];
        self.labelTitle.frame = CGRectMake(CGRectGetMaxX(self.imageViewIcon.frame)+10, CGRectGetMinY(self.imageViewIcon.frame)+5, ScreenWidth-20-CGRectGetMaxX(self.imageViewIcon.frame)-50, 40);
        self.labelTitle.numberOfLines = 2;
        self.labelTitle.textColor = titleColorLSZ;
        self.labelTitle.font = FONT_(16);
        [self addSubview:self.labelTitle];
 
        self.labelState = [[UILabel alloc]init];
        self.labelState.textColor = lightColor;
        self.labelState.font = FONT_(13);
        self.labelState.frame = CGRectMake(CGRectGetMaxX(self.labelTitle.frame)+5, (100-22)/2, 60, 22);
        [self addSubview:self.labelState];
        
        self.labelTime = [[UILabel alloc]init];
        self.labelTime.textColor = lightColor;
        self.labelTime.font = FONT_(13);

        self.labelTime.frame = CGRectMake(CGRectGetMinX(self.labelTitle.frame), CGRectGetMaxY(self.labelTitle.frame), ScreenWidth-CGRectGetMinX(self.labelTitle.frame)-10, 22);
        [self addSubview:self.labelTime];
        
    }
    return self;
}
-(void)setIndustryMg:(LSZIndustryMg *)industryMg
{
    [self.imageViewIcon sd_setImageWithURL:[NSURL URLWithString:industryMg.coverUrl] placeholderImage:[UIImage imageNamed:@"默认"]];
    self.labelTitle.text = industryMg.subject;
    if ([industryMg.feedback  isEqualToString:@"false"]) {
        self.labelState.text = @"未确认";
        self.labelState.textColor = themeColor;
    }else{
        self.labelState.text = @"已确认";
        self.labelState.textColor = lightColor;
    }
    NSArray *array = [industryMg.activityTime componentsSeparatedByString:@" "]; //从字符A中分隔成2个元素的数组
    self.labelTime.text =  [NSString stringWithFormat:@"%@",array[0]];
}
@end
